home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1984 December / 1984-12.d64 / word guess_64 (.txt) < prev   
Commodore BASIC  |  2022-09-20  |  4KB  |  142 lines

  1. 9 n=100:gt=30
  2. 10 gosub877
  3. 15 poke53280,2:poke53281,1:print"[147][154] "
  4. 17 v=54296:w=54276:a=54277:h=54273:l=54272:s=54278
  5. 20 dim le$(10),mi$(15),di$(10),wu(n),wd$(n),al$(27)
  6. 25 fori=1ton:readwd$(i):wu(i)=0:next
  7. 26 fori=1to27:readal$(i):next
  8. 28 gosub503
  9. 30 rn=int(n*rnd(1))+1
  10. 35 ifwu(rn)=1then110
  11. 40 wu(rn)=1
  12. 50 ln=len(wd$(rn))
  13. 55 fori=1toln:gn$=mid$(wd$(rn),i,1):le$(i)=gn$:next
  14. 80 print"[147]";tab(13);"guess this word"
  15. 85 v1=1205-ln:v2=1285-ln
  16. 90 fori=1toln:pokev1,32:pokev2,67:pokev1+l,0:pokev2+l,0:v1=v1+2:v2=v2+2:next
  17. 102 print"enter your guess "
  18. 104 print"letters guessed so far:"
  19. 106 it=ti/60
  20. 107 tl=ti:tv=tl-60:tu=gt*60
  21. 108 getgs$:ifgs$<>""then112
  22. 109 gosub310:iftu=0thengs$=chr$(45):goto115
  23. 110 ifgs$=""then108
  24. 112 iflen(gs$)>1then108
  25. 113 ifasc(gs$)<65orasc(gs$)>90then108
  26. 115 gu=gu+1
  27. 120 mi$(gu)=gs$
  28. 125 fori=1toln
  29. 130 ifle$(i)=di$(i)then145
  30. 140 ifgs$=le$(i)thendi$(i)=gs$:gosub610
  31. 145 nexti
  32. 160 forj=1to27
  33. 170 ifmi$(gu)=al$(j)then177
  34. 173 nextj
  35. 177 v3=1525-ln-5+gu*2-2
  36. 178 ifj=27thenj=45
  37. 180 pokev3,j:pokev3+l,0
  38. 185 gl=0:gl=ln+5-gu
  39. 190 print"guesses left:        [157][157][157][157][157][157]";gl
  40. 195 ag=1
  41. 200 fori=1toln:ifdi$(i)<>le$(i)thenag=0
  42. 202 nexti
  43. 204 ifag=0andgl>0then107
  44. 206 et=ti/60:ft=int(et-it):tm=int(ft/60):ts=ft-(tm*60)
  45. 208 ba$=str$(ts):sa$=mid$(ba$,2,2)
  46. 210 ifts<10thensa$="0"+mid$(ba$,2,1)
  47. 214 print"";tab(20);"guess time";tm;chr$(58);sa$
  48. 215 ifgl=0andag=0thengosub705
  49. 220 ifag=1thengosub810
  50. 225 print"[144]f3 to quit"
  51. 230 print"f5 to go to a different word[154]"
  52. 235 getac$:ifac$=""then235
  53. 240 ifac$="[135]"then28
  54. 245 ifac$="[134]"then print"[147]":end
  55. 250 goto235
  56. 310 tv=tv+60
  57. 320 tm=ti-tv
  58. 330 iftm<60then320
  59. 340 tu=(gt*60-tv+tl)/60
  60. 350 b$=str$(tu)
  61. 360 s$=mid$(b$,2,2)
  62. 370 iftu<10thens$="0"+mid$(b$,2,1)
  63. 380 print"";tab(24);"time : ";s$
  64. 390 return
  65. 503 sp$=" "
  66. 505 fori=1to10:le$(i)=sp$:mi$(i)=sp$:di$(i)=sp$:pk(i)=32:pm(i)=32:next
  67. 510 fori=11to15:mi$(i)=sp$:next
  68. 530 gu=0
  69. 540 return
  70. 610 forj=1to26
  71. 620 ifdi$(i)=al$(j)then625
  72. 623 nextj
  73. 625 v1=1205-ln+i*2-2
  74. 630 pokev1,j:pokevi+l,0
  75. 635 pokev,15:pokew,33:pokea,32:pokes,240
  76. 640 fort=1to10:pokeh,68:pokel,149:next
  77. 645 pokeh,0:pokel,0:pokew,0
  78. 650 fort=1to150:next
  79. 655 return
  80. 705 print"        sorry, you missed the word"
  81. 710 print"        it was ";wd$(rn)
  82. 715 pokev,15:pokew,33:pokea,32:pokes,240
  83. 720 fort=1to200:pokeh,6:pokel,16:next
  84. 725 pokeh,0:pokel,0:pokew,0
  85. 730 return
  86. 810 print"        *** congratulations ***"
  87. 815 pokev,15:pokew,33:pokea,32:pokes,240
  88. 820 fort=1to25:pokeh,68:pokel,149:next
  89. 825 pokeh,0:pokel,0
  90. 830 fort=1to100:pokeh,68:pokel,149:next
  91. 835 pokeh,0:pokel,0:pokew,0
  92. 850 return
  93. 877 poke53281,15:poke53280,10
  94. 880 print"[147]          [144]w o r d - g u e s s"
  95. 890 print:print:print"          instructions (y/n)"
  96. 895 getab$:ifab$=""then895
  97. 897 ifab$<>"y"then975
  98. 905 poke53281,13:poke53280,3
  99. 910 printchr$(144);"[147]               word-guess":print
  100. 915 print"   the object of word-guess is to de-"
  101. 920 print"termine the letters that makeup a word."
  102. 922 print"   the word can be up to 10 characters"
  103. 924 print"long.  you have 5 more guesses than the"
  104. 926 print"length of the word to determine all the"
  105. 928 print"letters."
  106. 932 print"   you have";gt;"seconds to make a guess."
  107. 934 print"if the letter is in the word, it will"
  108. 936 print"show in its proper slot. all letters"
  109. 938 print"used will be displayed for reference."
  110. 940 print"   multiple occurences of the same"
  111. 942 print"letter will be shown in all appropriate"
  112. 944 print"slots.":print
  113. 946 print"   after guessing a word, press:"
  114. 948 print"     f3[146] to quit":printtab(8)"or"
  115. 950 print"     f5[146] to guess another word"
  116. 952 print:printtab(15);"good luck!"
  117. 954 printtab(8);"press any key to start"
  118. 956 getad$:ifad$=""then956
  119. 975 return
  120. 1000 data degree,division,scrod,naive,thinker
  121. 1005 data water,light,regime,revamp,hymn
  122. 1010 data regency,sympathy,coupon,plant,spotlight
  123. 1015 data express,aardvark,rubber,eminence,boomerang
  124. 1020 data poetic,earthquake,mail,paralyze,heat
  125. 1025 data lapse,nitrogen,glass,idiot,memory
  126. 1030 data flower,computer,landmark,message,clarity
  127. 1035 data amazing,harmony,gallon,jellyfish,flame
  128. 1040 data envious,doorbell,destiny,daisy,corsage
  129. 1045 data canary,boycott,offer,beneficial,armadillo
  130. 1050 data angelic,month,balmy,margarine,lodge
  131. 1055 data original,oxygen,skiing,plasma,premature
  132. 1060 data special,regard,refugee,shake,watercress
  133. 1065 data saloon,washable,whatever,yolk,window
  134. 1070 data action,zenith,yellow,tricycle,yam
  135. 1075 data fetch,price,chemical,downwind,hibernate
  136. 1080 data counteract,cloverleaf,earthquake,flexible,queen
  137. 1085 data precedent,orange,construct,unicorn,important
  138. 1090 data medalist,yourself,novice,geography,expensive
  139. 1100 data monitor,headache,television,tax,language
  140. 2000 data a,b,c,d,e,f,g,h,i,j,k,l,m
  141. 2010 data n,o,p,q,r,s,t,u,v,w,x,y,z,-
  142.